package manager;
import feign.Feign;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import tk.mybatis.spring.annotation.MapperScan;
@EnableCaching
@EnableFeignClients
@Controller
@SpringBootApplication
@EnableDiscoveryClient
@Configuration
@MapperScan("manager.**.dao")
@ComponentScan(basePackages = {"manager.**"})
@EnableTransactionManagement
@EnableElasticsearchRepositories(basePackages = "manager.search.repository.*")
public class ItemApplication {
    public static void main(String[] args) {
        SpringApplication.run(ItemApplication.class, args);
    }
    @Bean
    public Feign.Builder feignBuilder(){
        return Feign.builder().requestInterceptor(new RequestInterceptor() {
            @Override
            public void apply(RequestTemplate requestTemplate) {
                 requestTemplate.header("cookie","shshshfpb=yopqZsc%2FfhZj1zvkOkc%2FY2A%3D%3D; __jdu=1639295931785707948021; shshshfpa=94db74cc-804d-2731-df92-b900e86e057e-1636999395; unpl=JF8EAMdnNSttXh9VBhsKSRBEQ1VSWw9fHh5QO24BXAoLTARSHlBOQUd7XlVdXhRKFR9ubhRVVVNJVw4fBysSEXteXVdZDEsWC2tXVgQFDQ8VXURJQlZAFDNVCV9dSRZRZjJWBFtdT1xWSAYYRRMfDlAKDlhCR1FpMjVkXlh7VAQrAhwQGEhVUFZfCE0eB2lmA1xYUUpXBSsyHCIge11SX1QJSicCX2Y1FgkET1EMGAoYXxBMX1xdVQxDFQNpbgFSXF5DUQwaARsiEXte; PCSYCityID=CN_440000_440300_0; TrackID=1HVt8vPZOsmi6NLCkFNHptJImQUGBv9IlzY5DAKUpIXyxdS_JFvR3eqaXifaEbmpxxD8LfNWWSWgSUgJTPIcbHi-judO3-Mjs77QdmIlV95E; thor=E6564FA5970C3349EB9B05E4DBFF75B97670F0CAF503A5D81AA48792E1127CBE2373CD84B078C37AA31890D9411FC9E2E9E59FB1105E63568F7DDC574549BF0F38B8B8C624DE27C600CEB6E12FCFCCD10E93E3F6344CD92329EE073D6638F45C371143EE9F1012154927BF440617E7FB22AE3720786BAD147350FE7D3884036A0F70CDCD5AD63CE67EF7707C94CB1082422B1BFD3A86F64A7FC8B2F13DEB2E0D; pinId=5uI2anvdXbM0wBcANweiQbV9-x-f3wj7; pin=jd_6226186e08a29; unick=xuwei_1866437; ceshi3.com=000; _tp=VgB5MG7K3adPs3CKXsJ9nKitNYwX7fQ2hVbMNkE2Whw%3D; _pst=jd_6226186e08a29; areaId=19; ipLoc-djd=19-1607-0-0; __jda=76161171.1639295931785707948021.1639295931.1646702989.1646703174.5; __jdc=76161171; shshshfp=fe57ee64c4769b446160d117092ed00e; shshshsID=6922d7c528e06eddb6dddd37aebf0f6f_6_1646703385933; 3AB9D23F7A4B3C9B=YSFFPIXKHHQDIYSREY43VSH2ILPU5GBB4GQ33D4UFQVZIRDRT5C6AUQSPUYM4TT6MITNFC7ILVVTPLZAULWIA22MWA; __jdb=76161171.10.1639295931785707948021|5.1646703174; __jdv=76161171|baidu-pinzhuan|t_288551095_baidupinzhuan|cpc|0f3d30c8dba7459bb52f2eb5eba8ac7d_0_7e0219c3e9974cfd8be859fb6af4cdbf|1646703464345");
                 requestTemplate.header("user-agent","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36");
            }
        });
    }
}
